package Day08_17;


import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class Test_FileInputStream01 {
    public static void main(String[] args) {
        FileInputStream fis = null;
        byte[] bytes = new byte[10];
        try {
            fis = new FileInputStream("myFile");
            int readCount = 0;

            while( (readCount = fis.read(bytes))!=-1 ){
                System.out.print( new String(bytes,0,readCount));
            }
        }catch(FileNotFoundException e){
            e.printStackTrace();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } finally{
            if(fis!=null){
                try {
                    fis.close();
                }catch(IOException e){
                    e.printStackTrace();
                }

            }
        }
    }
}
